package io.renren.modules.zhaopin.controller;

import java.util.Arrays;
import java.util.Map;

import io.renren.modules.zhaopin.dto.ReturnNotifyDto;
import io.renren.modules.zhaopin.entity.CertifierEntity;
import io.renren.modules.zhaopin.service.CertifierService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;



/**
 * 证明人表（Certifier）
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2024-03-24 15:02:39
 */
@RestController
@RequestMapping("/certifier")
public class CertifierController {
    @Autowired
    private CertifierService certifierService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("generator:certifier:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = certifierService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("generator:certifier:info")
    public R info(@PathVariable("id") String id){
		CertifierEntity certifier = certifierService.getById(id);

        return R.ok().put("certifier", certifier);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("generator:certifier:save")
    public R save(@RequestBody CertifierEntity certifier){
		certifierService.save(certifier);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("generator:certifier:update")
    public R update(@RequestBody CertifierEntity certifier){
		certifierService.updateById(certifier);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("generator:certifier:delete")
    public R delete(@RequestBody String[] ids){
		certifierService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
